import x_com_lib
from x_com import source_api
# ProductSale
def product_sale(param: source_api.ProductSaleInfo):
  product_sale_with_tag(param, "")

def product_sale_with_tag(param: source_api.ProductSaleInfo, tag: str):
  publish_info = x_com_lib.PyPublishInfo()
  publish_info.topic = "ProductSale"
  publish_info.tag = tag
  x_com_lib.stream.publish_message(publish_info, param)

# UserRegister
def user_register(param: source_api.UserInfo):
  user_register_with_tag(param, "")

def user_register_with_tag(param: source_api.UserInfo, tag: str):
  publish_info = x_com_lib.PyPublishInfo()
  publish_info.topic = "UserRegister"
  publish_info.tag = tag
  x_com_lib.stream.publish_message(publish_info, param)

# UserLogin
def user_login(param: source_api.UserLoginInfo):
  user_login_with_tag(param, "")

def user_login_with_tag(param: source_api.UserLoginInfo, tag: str):
  publish_info = x_com_lib.PyPublishInfo()
  publish_info.topic = "UserLogin"
  publish_info.tag = tag
  x_com_lib.stream.publish_message(publish_info, param)

